<%@page import="com.eos.orm.mybatis.model.SysRole"%>
<%@page import="com.eos.orm.mybatis.model.SysUser"%>
<%@page import="java.util.List"%>
<%@page import="com.eos.common.tool.DataCacheUtil"%>
<%@page contentType="text/html; charset=utf-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<% 
List<SysUser> userList = (List<SysUser>)request.getAttribute("userList");
%>
<form id="lookpagerForm" method="post" action="lookUpEmpList">	
	<input type="hidden" name="pageNum" value="${param.pageNum}" />	
</form>
<div class="pageHeader">
	<form onsubmit="return dialogSearch(this);" rel="lookpagerForm"  method="post" action="lookUpEmpList">
	<div class="searchBar" >
	<input type="hidden" name="numPerPage" value="${numPerPage}" />
	<input type="hidden" name="pageNum" value="${pageNum}" /> 
	<table class="searchContent" >
			<tr>
				<td>
					 <label>姓名：</label> 
                     <input type="text" class="txtinput" name="userName" value="${userName}"/>
				</td>			
				<td>
					<label>状态：</label> 
                    <select class="combox"  name="status">
                    		 <option value='2' ${status==2?'selected':''}>全部</option>
                            <option value='0' ${status==0?'selected':''} >有效</option>
                            <option value='1' ${status==1?'selected':''}>冻结</option>                            
                      </select>
				</td>
				<td>
					 <div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
			</ul>
		</div>
				</td>
			</tr>
		</table>
		
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
		
		</ul>
	</div>
	<table class="table" width="100%" layoutH="115">
		<thead>
			<tr>
				<th width="80">序号</th>
                <th>用户ID</th>
                <th>用户姓名</th>
                <th>用户角色</th>
                <th>用户邮箱</th>
                <th>用户电话</th>
                <th>用户手机</th>
                <th>用户创建时间</th>
                <th>备注</th>
                <th>状态</th>  
                <th>查找带回</th>             
			</tr>
		</thead>
		<tbody>
			<% 
				if(null != userList){
					int i = 1;
					for(SysUser user : userList){
						SysRole role = DataCacheUtil.getSysRole(user.getRoleId()) ;
			%> 
	 		<tr target="sid_empId" rel="<%=user.getId() %>">
               	<td><%=i++ %></td>
               	<td><%=user.getId() %></td>
               	<td><%=user.getUserName() %></td>
               	<td>
				<%=null != role ? role.getRoleName() : "" %>
				</td>
               	<td><%=user.getUserEmail() %></td>
               	<td><%=user.getUserTelephone() %></td>
               	<td><%=user.getUserMobile() %></td>
               	<td><%=user.getInsertTime().substring(0, 16) %></td>
               	<td><%=user.getUserDesc() %></td>
               	<td>
               		<%if(user.getStatus().equals("0")){ %>
               			<a style="color:#006400;text-decoration: none;">有效</a>
               		<%}else{%>
               			<a style="color:#f00;text-decoration: none;">冻结</a>
               		<%} %>
               	</td>
               	<td>
					<a class="btnSelect" href="javascript:$.bringBack({sysUser:'<%=user.getId() %>'})" title="查找带回">选择</a>
				</td>
              </tr>
          <%}
         } 
          %> 
		</tbody>
	</table>

	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<!-- pageNum:1是当更改numPerPage时，使pageNum=1重新开始，否则可能无数据 -->
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value,pageNum:1})">
				<option value="15" ${numPerPage==15?'selected':''}>15</option>
				<option value="20" ${numPerPage==20?'selected':''}>20</option>
				<option value="25" ${numPerPage==25?'selected':''}>25</option>
				<option value="50" ${numPerPage==50?'selected':''}>50</option>
				<option value="100" ${numPerPage==100?'selected':''}>100</option>
			</select>
			<span>条，共${totalCount }条 </span>
		</div>		
		<div class="pagination" targetType="navTab" totalCount="${totalCount }" numPerPage="${numPerPage}" pageNumShown="5" currentPage="${pageNum }"></div>

	</div>
</div>
